package com.rnkrsoft.suyan.config.server.config.dao;

import com.rnkrsoft.framework.orm.Pagination;
import com.rnkrsoft.framework.orm.jdbc.JdbcMapper;
import com.rnkrsoft.suyan.config.server.config.bo.FetchMachineBO;
import com.rnkrsoft.suyan.config.server.config.bo.ListMachineInfoByEnvironmentBO;
import com.rnkrsoft.suyan.config.server.config.bo.ListMachineInfoByProjectBO;
import com.rnkrsoft.suyan.config.server.config.bo.QueryMachineInfoBO;
import com.rnkrsoft.suyan.config.server.config.entity.MachineInfoEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by woate on 2018/6/17.
 */
public interface MachineInfoDAO extends JdbcMapper<MachineInfoEntity, String>{
    /**
     * 分页查询机器列表
     * @param pagination
     * @return
     */
    Pagination<QueryMachineInfoBO> selectMachinePage(Pagination<QueryMachineInfoBO> pagination);

    /**
     * 根据项目编号，获取其下所有正常的机器列表和参数个数，文件个数
     * @param projectId
     * @return
     */
    List<ListMachineInfoByProjectBO> listMachineByProject(@Param("projectId") String projectId);

    /**
     * 根据环境编号，获取其下所有正常的机器列表和参数个数，文件个数
     * @param environmentId
     * @return
     */
    List<ListMachineInfoByEnvironmentBO> listMachineByEnvironment(@Param("environmentId") String environmentId);

    /**
     * 根据机器状态显示机器列表
     * @param machineStatus
     * @return
     */
    List<FetchMachineBO> fetchMachine(@Param("machineStatus") Integer machineStatus);
}
